{% extends 'base_user_center.html' %}
{% load static from staticfiles %}
{% block topfiles %}

            <style type="text/css">
        .site_con .form_group #is_default{
            width:25px;
	        height:23px;
	        border:1px solid #ddd;
	        float: none;
	        outline:none;
	        margin-top: 0;
	        text-indent:10px;
            vertical-align: middle;

        }
        .site_con #div_is_fault{
            font-size: 14px;
        }
    </style>
{% endblock topfiles %}
{% block page_title %}收货地址{% endblock page_title %}

{% block right_content %}

		<div class="right_content clearfix">
				<h3 class="common_title2">收货地址</h3>
                {% if address %}
                    <div class="site_con">
					<dl>
						<dt>当前默认地址信息：</dt>
						<dd>地 址: {{ address.addr }}</dd>
                        <dd>收件人: {{ address.receiver }}</dd>
                        <dd>收件电话: {{ address.phone }}</dd>
					</dl>
				</div>
                {% else %}
				    <div class="site_con">
					<dl>
						<dt>默认地址：</dt>
						<dd>您目前暂无默认地址</dd>
					</dl>
				</div>
                {% endif %}
                <div class="site_con">
					<dl>
						<dt>所有已存地址：</dt>
                        {% if have_address %}
                            {% for every_address in have_address %}
                            <hr />
                            <dd>地 址: {{ every_address.addr }}</dd>
                            <dd>收件人: {{ every_address.receiver }}</dd>
                            <dd>收件电话: {{ every_address.phone }}</dd>
                            {% endfor %}
                        {% else %}
                            <dd>您目前暂无收货地址</dd>
                        {% endif %}

					</dl>
				</div>
				<h3 class="common_title2">添加地址</h3>
				<div class="site_con">
					<form action="{% url 'user:address' %}" method="post">
                        {% csrf_token %}
						<div class="form_group">
							<label>收件人：</label>
							<input type="text" name="receiver" required="required">
						</div>
						<div class="form_group form_group2">
							<label>详细地址：</label>
							<textarea class="site_area" name="direction" required="required"></textarea>
						</div>
						<div class="form_group">
							<label>邮编：</label>
							<input type="text" name="mail_code" required="required">
						</div>
						<div class="form_group">
							<label>手机：</label>
							<input type="text" name="phone_number" required="required">
						</div>
{#                        <div class="form_group" id="div_is_fault">#}
{#							<label>作为默认地址:</label>#}
{#							<input type="radio" id="is_default" name="is_default" checked value="1">是#}
{#                            <input type="radio" id="is_default" name="is_default" value="0">否#}
{#						</div>#}

						<input type="submit" name="" value="提交" class="info_submit">
					</form>
                    <label style="color:red">{{ errmsg }}</label>
				</div>
		</div>
	</div>
{% endblock right_content %}

